<template>
  <!-- 弹窗组件封装 -->

  <Dialog
    v-if="dialogVisible"
    v-model:dialogVisible="dialogVisible"
    :rowData="rowData"
    @submit="getTableList()"
  ></Dialog>
  <el-button type="primary" @click="handleAdd">新增弹窗</el-button>
  <el-button type="primary" @click="handleEdit">编辑弹窗</el-button>
</template>

<script setup>
import Dialog from '@/components/dialog/index.vue'
const dialogVisible = ref(false)
const rowData = ref({})
const handleAdd = () => {
  dialogVisible.value = true
  rowData.value = { type: 'add' }
}
const handleEdit = () => {
  dialogVisible.value = true
  rowData.value = { type: 'edit', ...row }
  // rowData.value = { type: 'edit', age: 12, id: 1 }
}
const getTableList = () => {
  console.log('获取列表')
}
</script>

<style lang="scss" scoped></style>
